-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: bulk ingester might skip listener requests #867
Conversation
💚 CLA has been signed |
Hello @fabriziofortino, thank you for the contribution and for highlighting this issue. I have tested your solution and while it helps mitigate the problem, when dealing with many requests there's still a possibility that the latest listener tasks are ignored because of the shutdown. I'll do more testing to figure out a way to handle this reliably, I'll let you know so that we can fix this PR and merge it. |
@fabriziofortino do you mind if I push on this branch? |
@l-trotta no problem, go ahead! |
@l-trotta I have also noticed this: in the if (scheduler != null && !isExternalScheduler) {
scheduler.shutdownNow();
} This will try to cancel the already submitted tasks. Shouldn't we call |
84a395b
to
324af0a
Compare
@fabriziofortino you're correct, however with the new changes it shouldn't be a problem either way, you can take a look :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for having caught this and the fix!
* fix: bulk ingester might skip lister requests * minor: fix style * always waiting for listener to be done before closing --------- Co-authored-by: Laura Trotta <laura.trotta@elastic.co> Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com>
* fix: bulk ingester might skip lister requests * minor: fix style * always waiting for listener to be done before closing --------- Co-authored-by: Laura Trotta <laura.trotta@elastic.co> Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com>
* fix: bulk ingester might skip lister requests * minor: fix style * always waiting for listener to be done before closing --------- Co-authored-by: Laura Trotta <laura.trotta@elastic.co> Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com>
Regression introduced in 8.15.0 appears to be fixed (elastic/elasticsearch-java#867). This partially reverts commit a345a15.
This fix does not seem to be included in the 8.16.0 release. It looks like the 8.16 branch was cut on Sep 10, while this pull request was merged into 8.15 on Sep 12 and then never ported to 8.16. Can you please take a look? This affects our bulk indexing. |
@blackwinter you're correct, I backported it to 8.x where 8.16 was branched from, but forgot 8.16 itself. Sorry for the inconvenience, I'll port it right away, I'll let you know if we made it in time for it to be in 8.16.1 |
* fix: bulk ingester might skip lister requests * minor: fix style * always waiting for listener to be done before closing --------- Co-authored-by: Laura Trotta <laura.trotta@elastic.co> Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com>
@blackwinter no luck, didn't make it in time for the release. You can either wait for 8.16.2, which should be out next month, or you can use 8.16.1-SNAPSHOT from our snapshot repo, for example in gradle:
|
Too bad. But thanks anyway. The snapshot seems to work (it's also available from Sonatype). |
Skipping 8.16.0/.1 because they don't include the fix for elastic/elasticsearch-java#867.
When BulkIngester uses the internal scheduler it might fail notifying the listener because the scheduler gets terminated before the
submit
is called. This happens because the close condition is signalled beforesubmit
is invoked. This PR fixes a regression introduced in #830